1.4. How Virtual Panels application works

Virtual Panels style program consists of declarations of objects' instances and procedures attached to Controls and activated when a button is "pushed" or menu item is chosen. Buttons as well as menus are linked in groups and allow nesting.

As you run application Virtual Panels core initializes control subsystem, initializes all objects in main() function you have declared, and then program enters in the Virtual Panels loop. We call it Main Loop. Another loop also may be descended from the Main Loop as button- or menu-attached procedure is called. Loop function drives button and menu subsystems, drags objects on the screen, hides or pops them, performs memory management and so on. All these chores are performed by Virtual Panels core and all you need is to call bsButSys.Loop(Backgr). Here bsButSys is the current button system class and Backgr is a procedure which will be executed while Virtual Panels is polling console. As you press ESC on the keyboard Loop quits and if you have no further intentions you can save Virtual Panels configuration calling object::SaveCnfg("CnfFileName") in file CnfFileName and exit from the program.